Apparatus and method for detecting and compensating for illuminant intensity changes within an image

ABSTRACT

An apparatus such as a digital camera includes an image sensor array adapted to capture a scene into electrical values and a reference detector proximal to the sensor array for detecting illuminant intensities. The reference detector at least partially surrounds the image sensor array. The reference detector is read multiple times during the frame period in which the image sensor array captures a scene to detect illuminant intensities during the same frame period. Using the illuminant intensities, the phase and the amplitude of the flicker of the illuminant are extracted. Using the phase and the amplitude parameters, a flicker correction signal is synthesized. The flicker correction signal is used to correct the captured image data to reduce or eliminate adverse effects of flicker on the captured image.

BACKGROUND

The present invention relates to digital imaging systems. Moreparticularly, the present invention relates to the technique ofdetecting and compensating for illuminant intensity changes in digitalimaging systems.

In digital cameras, a scene is captured by using a lens to form an imageof the scene on the surface of an array of sensors, such as photodiodes.Each sensor detects light from a tiny portion of the scene. At eachsensor, the detected light is converted into an electrical signal, andthen into a digital value indicating the intensity of the light detectedby that sensor. Then, the digital values from all of the sensors of thearray are combined to form an image.

Popular sensor arrays include CMOS (complementary metal-oxidesemiconductor) sensors and CCDs (charge-coupled devices). The sensorarray often includes a rectangular layout of many hundreds of thousands,millions, or even greater number of sensors, each sensor providing adigital value, or a pixel, of information. For example, a rectangularsensor array arranged in 640 columns and 480 rows has 307,200 sensors,or pixels. A digital value from a sensor is defined as a pixel of theimage. For convenience, terms “sensor” and “pixel” are herein usedinterchangeably unless otherwise noted, and each sensor, or pixel, isreferred generically as P_(i,j) where i,j indicates that the pixel islocated at i^(th) column at j^(th) row of a rectangular sensor arrayhaving M columns and N rows, the value of i ranging from 1 to M,inclusive, and the value of j ranging from 1 to N, inclusive.

To capture the scene, the electrical value of each of the sensors of thearray is read serially. That is, the camera reads the digital values ofeach of the sensors beginning with the first sensor, P_(1,1) and endingwith the last sensor, P_(M,N). Typically, the pixels are read row-wise,that is, row by row. To read each sensor, the sensor is first reset to apredetermined value, for example, zero. Then, the value of the sensor isread after an exposure period. The exposure period determines how longthe sensor being read has been exposed to the scene. The exposure periodis also referred to an integration period. This is because the sensorsums up, or integrates, the light it receives during the exposureperiod. A rolling shutter technique is often used to read the sensorarray. The rolling shutter is implemented by sequentially resetting eachrow of sensors and sequentially reading the values of each row ofsensors. The duration or the period of time between the reset and theread is the integration period. The period of time taken to read theentire array of sensors is often referred to as a frame period or animage capture period.

The scene captured during the frame period is often illuminated by anelectrically powered light having flicker. Flicker is the wavering ofthe characteristics of light source with time, including variations oflight intensity, color temperature, or spatial position. Flicker isoften too rapid for the human eye to detect. Some common light sourcesthat exhibit flicker are fluorescent lights often used in office andindustrial settings and tungsten halogen incandescent lamps. Forexample, in fluorescent lamps, the phosphors in the lamp are excited ateach peak in the waveform of the AC (alternating current) power source.Between the peaks of the AC power, the light intensity is diminished.The light pulses that are produced have a flicker frequency that istwice that of the AC source. In the United States of America, thecommonly available AC power has a sinusoidal waveform of approximately60 Hz producing light having 120 Hz flicker frequency. That is, afluorescent lamp produces light that cycles from high intensity to lowintensity at approximately every 120^(th) of a second. Thus, the flickerperiod is 8.3 milliseconds (ms). The flicker period can vary fromcountry to country depending on the frequency of the AC power source.The flicker due to the AC power waveform is illustrated in FIG. 1 asilluminant intensity curve 12 of the graph 10.

If the light flickers during the frame period, then undesirableartifacts can appear in the captured image. This is because someportions, or rows, of the sensor array are exposed to the scene and readwhen the scene is illuminated with relatively high intensity light whileother portions, or rows, of the sensor array are exposed to the sceneand read when the scene is illuminated with relatively low intensitylight. Such undesirable artifacts can include, for example, variationsin brightness and horizontal bands within a captured image.

A common frame rate of various sensor arrays is 30 frames per second.That is, typically, it takes about 33.3 ms to capture a scene. The frameperiod is also illustrated in FIG. 1 as beginning at time T₀ and endingat time T₈. A frame period can include one or more flicker periodsproducing visible artifacts in the captured image. As illustrated,within the frame period, four flicker periods occur, each flicker periodhaving a period of time of relative low intensity of the light from theilluminant.

FIG. 2 illustrates a sensor array 20 in a rectangular grid having Mcolumns and N rows of pixels. For example, M can be 640 and N can be480. The first pixel is illustrated as P_(1,1), a generic pixel atColumn i and Row j as P_(i,j), and the last pixel at Column M and Row Nas P_(M,N). To avoid clutter, not all rows or columns are illustrated;however, the presence of the columns and the rows not illustrated areindicated by ellipses 22. FIG. 2 also illustrates the graph 10 includingthe illuminant intensity curve 12, rotated.

To capture a scene lighted by an illuminant, the sensor array 20 is readbeginning at time T₀, row-wise, and ending at time T₈. On one hand, attimes T₀, T₂, T₄, T₆, and T₈, light from the illuminant is at itshighest intensity. On the other hand, at times T₁, T₃, T₅, and T₇, lightfrom the illuminant is at its lowest intensity. Accordingly, rows ofsensors detecting light at or near these times (T₁, T₃, T₅, and T₇)receive relatively less light than the rows of sensors detecting lightduring the other time periods (T₀, T₂, T₄, T₆, and T₈). For convenience,the rows of sensors detecting light at or near the times T₁, T₃, T₅, andT₇ are referred herein as ROW(T₁), ROW(T₃), ROW(T₅), and ROW (T₇),respectively. This results in a final image having dark bands at theserows.

To alleviate this problem various methods have been suggested. Forexample, one approach that is suggested involves the use of histogramsof light levels of different image frames. The histograms are comparedso that the variation in the mean level of illumination as a function oftime can be removed. This approach is not applicable where only a singleimage frame is available. In another approach, the integration period isrestricted to integer multiples of the flicker period. This places anundesirable lower limit on the integration period and introducespossible overexposure issues for brightly illuminated scenes. Otherapproaches include use of mirrors, prisms, and other bulky and expensivecomponents to marginally alleviate the artifacts problem with varyingdegree of success.

There remains a need for an improved digital imaging system that detectsilluminant intensity changes within an image capture period andcompensates the captured digital image from effects of the illuminantintensity changes.

SUMMARY

The need is met by the present invention. In a first embodiment of thepresent invention, an input apparatus includes an image sensor arrayadapted to capture a scene into electrical values and a referencedetector proximal to the sensor array for detecting illuminantintensities.

In a second embodiment of the present invention, a method of detectingilluminant intensity changes is disclosed. First, a reference detectoris reset. Then, a set of sensors of an image sensor array is read. Next,the reference detector is read. These steps are repeated for each set ofsensors of the image sensor array.

In a third embodiment of the present invention, a digital cameraincludes an image sensor array adapted to capture a scene intoelectrical values within an image capture period and a referencedetector proximal to the sensor array adapted to detect illuminantintensities within the image capture period. A processor connected tothe image sensor array is adapted to process the electrical values andmemory connected to the processor is adapted to store the electricalvalues.

In a fourth embodiment of the present invention, a method of processinga digital image is disclosed. First, illuminant intensities are detectedduring a frame period of the digital image, the illuminant intensitiesconverted to digital values, the illuminant intensities having flickerat a flicker frequency. Then, flicker correction parameters areextracted from the illuminant intensities. Next, flicker correctionsignal is synthesized. Finally, the flicker correction signal is appliedto the digital image.

In a fifth embodiment of the present invention, an apparatus includes animage sensor array adapted to capture a scene into electrical valueswithin an image capture period and reference detector adapted to detectilluminant intensities within the image capture period. A processor isconnected to the image sensor array is adapted to process the electricalvalues. Memory is connected to the processor and is adapted to store theelectrical values.

Other aspects and advantages of the present invention will becomeapparent from the following detailed description, taken in conjunctionwith the accompanying drawings, illustrating by way of example theprinciples of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a graph including flicker characteristics of anilluminant intensity curve;

FIG. 2 illustrates a sensor array in relationship to the graph of FIG.1;

FIG. 3 illustrates an apparatus according to one embodiment of thepresent invention;

FIGS. 4A-4D illustrate various possible embodiments of a referencedetector in relationship to an image array;

FIGS. 5, 6, 7A and 7B are more detailed illustrations of variousportions of the apparatus of FIG. 3.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 3 illustrates an apparatus 30 according to one embodiment of thepresent invention. The apparatus 30 can be, for example, a digitalcamera, camcorder, or a mobile communication device. Typically, theapparatus 30 has a lens 32 for focusing light from a scene (not shown)onto an imaging sensor array 34 for capture and conversion intoelectrical signals. The light from the scene may have originated from anilluminant (not shown) having flicker at a flicker frequency asdiscussed above and reflected from the scene for capture by the imagingsensor array 34. The light from the scene is also detected by areference detector 36 situated proximal to the imaging sensor array 34for detecting illuminant intensities.

The sensor array 34 is typically an array of photo-detectors thatreceive focused light and converts the light into captured electricalsignals that, ultimately, are converted to digital electronic signalsrepresenting digital values. The digital values represent the scenecaptured by the apparatus 30. The sensor array 34 can be fabricated on asubstrate that can also include an analog-to-digital converter 38 (ADC)to convert the captured electrical signals to digital electronic values.A processor 40, connected to the sensor array 34, receives the digitalvalues and can store the digital values in storage 50 as captured imagedata 52. The sensor array 34 can be, for example, a CMOS (complementarymetal-oxide semiconductor) photo-detector array. Front view of thesensor array 34 and the reference detector 36 is illustrated in FIG. 5,the sensor array 34 including the rows and columns of pixels similar tothe sensor array 20 of FIG. 2. For convenience, the pixels, the rows,and the columns of the sensor array 34 are referred to using the samenotations as the pixels, the rows, and the columns of the sensor array20 as illustrated in FIG. 2. As for the processor 40, variousimplementations are known in the art. For example, the processor 40 canbe a proprietary limited instruction set CPU, or an off-the-shelfcomponent such as an ARM946E-S. Moreover, for the storage 50, bothtemporary and permanent storage elements can be used, for example, RAM(random access memory), compact flash memory, or magnetic storage.

The Reference Detector

As already discussed, during the frame period in which the scene iscaptured, the light illuminating the scene can flicker. Such flickercauses undesirable artifacts such as dark bands across the capturedimage represented by the captured image data 52. The flicker can bedetected by detecting illuminant intensities during the frame period ofthe digital image 52 using the reference detector 36. To detect theflicker affecting the image being captured, the reference detector 36 ispreferably placed proximal or adjacent to the sensor array 34, thereference detector 36 has a field of view similar to the field of viewof the image sensor array 34, or both.

FIGS. 4A through 4D illustrate front views of alternative embodiments ofthe reference detector 36. Portions of these alternative embodiments aresimilar to those shown in FIG. 3. For convenience, portions of FIGS. 4Athrough 4D that are similar to portions of FIG. 3 are assigned the samereference numerals, analogous but changed portions are assigned the samereference numerals accompanied by a letter “a,” “b,” “c,” or “d,” anddifferent portions are assigned different reference numerals.

Referring to FIGS. 4A through 4D, various embodiments of the referencedetectors—36 a, 36 b, 36 c, and 36 d—are illustrated in relationship tothe image array 34. In the illustrations, the reference detectors 36 athrough 36 d at least partially surround the image sensor array 34. InFIG. 4B the left and right pieces of the reference detector 36 b can beelectrically connected to operate as a single reference detector 36 b.In FIG. 4D, the reference detector 34 d is illustrated surrounding theimage sensor array 34. The reference detectors 36 a through 36 d can beimplemented using known photo detector technology, and, can befabricated along with the image array 34. For convenience, referencenumeral 36 is used herein below to generally and generically refer to areference detector of any configuration.

Another view of the reference detector 110 and the image sensor array104 is illustrated in FIG. 5, the sensor array having M columns and Nrows of sensors, or pixels. Referring to FIG. 5, to detect the flicker,the reference detector 110 can be reset and read at predeterminedintervals. For example, to detect flicker, the reference detector 110 isreset before reading a row of pixels. Next, a row of pixels is read.Then, the reference detector 110 read. These steps are repeated for eachof row of the sensor array 104. Resetting the reference detector 110includes setting the reference detector 110 to an initial, default,value or an initial electrical state.

Detecting Illuminant Intensities

The operations of the reference detector to detect illuminant intensitychanges can be discussed using FIG. 5. The illuminant intensity duringat period of time can be measured by resetting the reference detector36, exposing the reference detector 36 to the scene for a period of time(integration period for the reference detector 36), and reading thereference detector 36. Accordingly, to detect illuminant intensity orilluminant intensity changes during a frame period in which a scene iscaptured by the sensor array 34, the reference detector 36 is reset, aset of sensors (for example a row of sensors) of the image sensor array34 is read (during which the reference detector 36 is exposed to thescene), and the reference detector 36 is read. These steps are repeatedfor each set (or row) of the sensor array 34.

Depending on how often the reference detector 36 is to be sampled, theset of sensors read during the integration period for the referencedetector 36, the set of sensors can include multiples of rows, themultiple factor ranging from less than one to N where N is the number ofrows in the image sensor array 34. For example, if the multiple is 0.5,then the reference detector 36 is sampled after each ½ of a row of theimage sensor array 34 is read. Of course, the sensors of the imagingsensor array 34 are reset prior to being read also. The integrationperiod for the sensors of the imaging sensor array 34 is furtherdiscussed above and is likely to be different than the integrationperiod of the reference detector.

When the reference detector 36 is sampled, the electrical signals areconverted into digital electrical values by the ADC converter 38. Asillustrated by the illuminant intensity curve 12 of FIG. 5, theilluminant intensities have flicker at a flicker frequency, for example,at 120 Hz as discussed above. The converted output of the referencedetector. 36 is designated, for convenience, as the reference detectoroutput 39.

Extracting Flicker Correction Parameters

The flicker waveform produced by a fluorescent or incandescent lamp canbe modeled by a simple function, such as the sine-squared functionF(t)=1.0+(a)sin²(wt+p)  (Eq. 1)where

t is time;

F(t) is model flicker waveform produced;

a is amplitude;

w is frequency of the AC source driving the lamp; and

p is phase.

Similarly, flicker waveform produced by a fluorescent or incandescentlamp can be modeled by the Fourier seriesF(t)=1.0+Σ(a _(i))sin(iwt+p _(i))  (Eq. 2)where

t is time;

F(t) is model flicker waveform produced;

a is amplitude;

i is the harmonic number of the series Practical flicker waveforms canbe modeled accurately with only a few harmonics.

w is fundamental frequency of the flicker waveform; and

p_(i) is phase of the model flicker waveform at index i.

The Fourier series model (Eq. 2) is just a generalization of thesine-squared model (Eq. 1). In the Fourier series model, the fundamentalfrequency is twice the AC power source frequency. Only the zero andfirst harmonic terms have non-zero values. For other waveforms, therelationship between the higher-order coefficients and the fundamentalcoefficient can be determined from a priori measurements of differentlight sources. As an example, if the flicker waveform were a rectifiedsine wave [F(t)=Abs(Sin(wt))], then the amplitudes of the first fewcoefficients would be: [0.63 (DC term), 0.21 (fundamental), 0.04 (secondharmonic) and 0.02 (third harmonic)]. The only parameters that need beextracted from the reference detector output are amplitude and phase ofthe fundamental component of the flicker frequency and the mean signalamplitude. These parameters can be extracted readily because they areessentially unvarying for any given light source.

One method to extract the phase and modulation amplitude of thefundamental component of the illuminant intensity including the flickersignal is to perform sine and cosine transforms on the referencedetector output 39. The sine and cosine transforms are obtained byintegrating the product of the reference detector output with sine andcosine waves at the flicker frequency, over an interval of a number offlicker periods. The sine and cosine waveforms are computed digitallyusing a priori knowledge of the flicker frequency. For example, if theflicker frequency was 120 Hz, and the frame rate was 30 Hz, Theintegration would be performed over four flicker periods. If the imagingarray contained 480 rows, and the reference signal was measured everyrow period, there would be 120 flicker samples per flicker period. Thesesamples would be digitally multiplied by 120 pre-computed values of sineand cosine waves of that period. An apodization function can be appliedto the integrand to improve the accuracy. Apodization functions forcethe integrand to become continuous at the ends of the integrationinterval, reducing the effect of camera motion on the sine and cosinetransforms.

The processor 40 of FIG. 3 can be configured or programmed to performthese functions. Alternatively, an extractor circuit 60 of FIG. 3including an IQ demodulator and low pass filter can be used. Theextractor circuit 60 is illustrated in more detail in FIG. 6. Referringto FIGS. 3 and 6, the reference detector output 39 of the referencedetector 36 enters the extractor circuit 60. In the extractor circuit60, in a first path, the output 39 is digitally multiplied by thedigital samples of a sine wave at the flicker frequency and is filteredby a first low-pass filter 62 a to obtain an average value of thein-phase (I) channel of the flicker signal that is not strongly effectedby changes in scene content. The filtered signal is then integrated overone flicker period by a first flicker period integrator 64 a to removeany feed-through at the flicker frequency.

In the extractor circuit 60, in a second path, the output 39 isdigitally multiplied by the digital samples of a cosine wave at theflick frequency and is filtered by a second low-pass filter 62 b toobtain an average value of the quadrature-phase (Q) channel of theflicker signal that is not strongly effected by changes in scenecontent. The filtered signal is then integrated over one flicker periodby a second flicker period integrator 64 b to remove any feed-through atthe flicker frequency.

In a third path, the output 39 is filtered by a third low-pass filter 62c and then integrated over one flicker period by a third flicker periodintegrator 64 c resulting in the DC (direct-current) component of theillumination signal. This DC component is needed to generate acorrection signal with the correct amplitude relative to the unvaryingcomponent of illumination.

A phase computing circuit 66 uses the I-component of the IQ demodulationto compute the phase 69 a of the flicker of the illuminant signal ascaptured by the reference detector 36. The phase is computed as thearctangent of the ratio of the I and the Q channel flicker signals.

An amplitude computing circuit 68 uses the I, the Q, and the DC signalsto compute the amplitude 69 b of the flicker of the illuminant signal ascaptured by the reference detector 36. The amplitude is computed as thesquare root of the sum of the squares of the I and Q channel flickersignals.

The operation of the extraction circuit 60 is simplified when the frameperiod is an integer multiple of flicker period. Under thesecircumstances the sine and cosine values can be drawn from a single lookup table. Otherwise they must be computed for each sample. The low-passfilters 62 a, 62 b, and 62 c can be IIR (infinite impulse response)filters or FIR (finite impulse response) filters.

Synthesizing a Flicker Correction Signal

Once the flicker phase 69 a and modulation amplitude 69 b aredetermined, a flicker correction signal can be synthesized. If theflicker waveform is replicated directly, then it must be divided fromthe image array data on a row-by-row basis. Alternatively the inverse ofthe flicker waveform can be synthesized. In this case it can multiplythe image array data. The flicker contribution to the image array pixelswill depend on the exposure period. If the exposure period is differentfrom the reference pixel exposure period, the correction signal must beadjusted. The waveform used for correction is preferably the convolutionof the flicker waveform with a rectangle of width equal to the exposureperiod used to capture the original image. With the simple flickermodels, the integral can be performed analytically. The exposure periodadjustment can be built into the circuit that synthesizes the correctionsignal.

FIG. 7A illustrates one embodiment of the correction signal synthesiscircuit 70 of FIG. 3. Referring to FIGS. 3 and 7A, the correction signalsynthesis circuit 70 can be a direct digital synthesizer (DDS) alsoknown as a Numerically Controller Modulation Oscillator. Such circuitsare known in the art and one example of it is disclosed, for example, inU.S. Pat. No. 3,633,017 issued to Crooke and Hanna. In the correctionsignal synthesis circuit 70 is illustrated as a DDS 70 including alookup memory 72 stores consecutive samples over an interval 0 to 360degrees of a waveform. The lookup memory 72 is driven by a digitalaccumulator 74 referred to as the phase accumulator 74.

The phase accumulator 74 accumulates the phase of the signal beinggenerated. Such circuit is known in the art to generate a synthesizedwaveform w(t) 79. The frequency of the synthesized waveform w(t) 79 isdetermined by the input to the phase accumulator 70. The frequency inHertz, F, is given byF=K _(f)/2^(N) *F _(CLX)where

F is the desired output frequency in Hertz which can be, for example 50Hz in Europe and 60 Hz in the United States of America;

K_(f) is the constant value to produce the desired output frequency fromthe DDS 70;

N is the number of bits (width of the register) of the accumulator 74,for example 16 bits; and

F_(CLK) is the frequency of the clock signal applied to the phaseaccumulator 74.

An alternate embodiment of the correction signal synthesis circuit 70 ofFIGS. 3 and 7A having certain alternative configuration is illustratedin FIG. 7B. Portions of FIG. 7B are similar to those shown in FIG. 7A.For convenience, portions in FIG. 7B that are similar to portions inFIG. 7A are assigned the same reference numerals, analogous but changedcomponents are assigned the same reference numerals accompanied byletter “a,” and different portions are assigned different referencenumerals. The exceptions to this nomenclature are reference numbers 69 aand 69 b which are used in FIGS. 6 and 7B. The alternative embodiment ofthe correction signal synthesis circuit 70 a is an enhanced DDS thatincludes a multiplier 76 before at the output of the lookup memory 72which allows convenient control of the amplitude. Further, an adder 78at the output of the phase accumulator 74 allows control of the phase byadding time offset to the lookup memory 72.

The phase accumulator 74 is incremented once for each row of image dataand is programmed with a value of K such that F(t) equals the flickerfrequency. Alternatively, the phase accumulator 74 can be clocked withan independent clock source. The lookup memory 72 can be programmed witha sinusoid or with some other waveform which more closely models theflicker. Here, input K_(f) is the constant value to produce the desiredoutput frequency from the DDS 70 a as already discussed in connectionwith FIG. 7A above; input K_(p) is the phrase control output 69 a of theextractor circuit 60 of FIG. 6; and input K_(p) is the phrase controloutput 69 a of the extractor circuit 60 of FIG. 6.

Applying The Flicker Correction Signal

Referring again to FIG. 3, the flicker correction signal w(t) 79 isapplied to the image data 52 by multiplying the image data 52 by thecorrection signal 79. For example, if one correction signal value isgenerated for each row of pixels of the image sensor array 34, each rowof pixels is multiplied by its corresponding correction signal. Thecorrection signal is then updated for the next row. This operationproduces a flicker corrected image output 89. The flicker correctionshould not be applied to saturated pixels. Otherwise flicker will beadded to the image in those regions where the pixel values are clipped.

In the illustrated embodiment, the image sensor array 34 produces acaptured image in raster order. The correction signal synthesis circuit70 generates a flicker correction signal 79 which modulates the datafrom the image sensor array 34. The flicker corrected image output 89may be further processed by additional circuits 90 or steps foradditional effects including, for example, color interpolation, colorcorrection, gamma correction, sharpening, and noise removal.Alternatively, the positions of the correction signal synthesis circuit70 and the additional circuits 90 can be interchanged.

From the foregoing, it will be apparent that the apparatus and themethods of the present invention are novel and offer advantages over thecurrent art. Although a specific embodiment of the invention isdescribed and illustrated above, the invention is not to be limited tothe specific forms or arrangements of parts so described andillustrated. The invention is limited only by the claims.

1. An apparatus comprising: an image sensor array adapted to capture ascene into electrical values, a border of the image sensor arraydefining a plurality of sides thereof; a reference detector proximal tosaid sensor array for detecting an illuminant intensity, the referencedetector being disposed to surround at least a portion of each of twoadjacent sides of the image sensor array; and a processor (1) receivingelectrical values corresponding to the detected illuminant intensityfrom the reference detector, (2) computing at least a phase of theilluminant intensity using the electrical values from the referencedetector and (3) controlling the generation of a flicker correctionsignal having a phase matching the computed phase of the illuminantintensity.
 2. The apparatus recited in claim 1 wherein said apparatus isa digital camera.
 3. The apparatus recited in claim 1 wherein said imagesensor array comprises CMOS image sensors.
 4. The apparatus recited inclaim 1 wherein said reference detector is adjacent to at least twosides of said image sensor array.
 5. The apparatus recited in claim 1wherein said reference detector surrounds said image sensor array. 6.The apparatus recited in claim 1 wherein said image sensor array has afield of view and said reference detector has a field of view similar tosaid field of view of said image sensor array.
 7. A method of detectingilluminant intensity changes, said method comprising: a. resetting areference detector; b. reading a set of sensors of an image sensorarray; c. reading the reference detector; d. repeating steps a through cfor each set of sensors of said image sensor array; and computing anamplitude and a phase of an illuminant intensity using the readings fromthe reference detector; wherein the computing of the amplitude includescorrecting the amplitude of the illuminant intensity for unvaryingcomponents thereof to detect changes in the illuminant intensity.
 8. Themethod recited in claim 7 wherein the set of sensors comprises amultiple row of sensors.
 9. The method recited in claim 7 wherein saidreference detector is adjacent to said image sensor array.
 10. A methodof processing a digital image, the method comprising: detectingilluminant intensities during a frame period of the digital image, theilluminant intensities converted to digital values, the illuminantintensities having flicker at a flicker frequency; extracting flickercorrection parameters from the illuminant intensities, the flickercorrection parameters include amplitude and phase components of theilluminant intensity, the amplitude component of the illuminantintensity being corrected for an unvarying component of the illuminantintensity; synthesizing a flicker correction signal from the flickercorrection parameters; and applying the flicker correction signal to thedigital image.
 11. The method recited in claim 10 wherein said step ofdetecting illuminant intensity values comprises: a. resetting areference detector; b. reading a row of sensors of an image sensorarray; c. reading the reference detector; and d. repeating steps athrough c for each of the rows of said image sensor array.
 12. Themethod recited in claim 10 wherein said step of extracting flickercorrection parameters comprises performing sine and cosine transforms onthe illuminant intensity values.
 13. The method recited in claim 12wherein the sine and cosine transforms are obtained by integratingproduct of the illuminant intensity values with sine and cosine waves atthe flicker frequency over an interval of a number of flicker periods.14. The method recited in claim 13 further comprising applyingapodization function to the integrand to improve accuracy.
 15. Themethod recited in claim 10 wherein said step of extracting flickercorrection parameters comprises performing IQ demodulation.
 16. Themethod recited in claim 10 wherein said step of applying flickercorrection to the digital image comprises multiplying the illuminantintensity values by the flicker correction signal.
 17. The methodrecited in claim 16 wherein said step of applying flicker correction isskipped for saturated pixels of the illuminant intensity values.
 18. Anapparatus comprising: an image sensor array adapted to capture a sceneinto electrical values within an image capture period, a border of theimage sensor array defining a plurality of sides thereof; a referencedetector adapted to detect an illuminant intensity within the imagecapture period, the reference detector being disposed to surround atleast a portion of each of two adjacent sides of the image sensor array;a processor connected to said image sensor array and the referencedetector and adapted to process the electrical values from the imagesensor array and to compute at least a phase of the illuminant intensityusing readings from the reference detector to generate a flickercorrection signal having a phase matching the computed phase of theilluminant intensity; and memory connected to said processor and adaptedto store the electrical values.
 19. The apparatus recited in claim 18further comprising an extractor circuit.
 20. The apparatus recited inclaim 19 wherein said extractor circuit comprises an IQ demodulator. 21.The apparatus recited in claim 18 further comprising a correction signalsynthesis circuit.
 22. The apparatus recited in claim 21 wherein saidcorrection signal synthesis circuit comprises a direct digitalsynthesizer.
 23. The apparatus recited in claim 1, wherein the processorfurther computes an amplitude of the illuminant intensity using thereadings from the reference detector such that the computation of theamplitude includes correcting the amplitude of the illuminant intensityfor unvarying components thereof to detect changes in the illuminantintensity.
 24. A method of detecting illuminant intensity changes, saidmethod comprising: resetting a reference detector; reading a set ofsensors of an image sensor array; reading the reference detector;repeating the resetting of the reference detector and the readings ofthe set of sensors and the reference detector for each set of sensors ofsaid image sensor array; computing at least a phase of an illuminantintensity using the readings from the reference detector; and generatinga flicker correction signal having a phase that matches the computedphase of the illuminant intensity.